const router = require('koa-router')()
const { show } = require('../mysql/index.js')



router.post('/show', async (ctx, next) => {
  try {
    const res = await show(ctx.request.body.id)
    ctx.body = {
      code: '1',
      data: res,
      msg: '查找成功'
    }
  } catch (error) {
    ctx.body = {
      code: '2',
      data: error,
      msg: '服务器异常'
    }
  }
})

module.exports = router